<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE MagicHash #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">--</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- GHCi Interactive debugging commands</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Pepe Iborra (supported by Google SoC) 2006</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- ToDo: lots of violation of layering here.  This module should</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- decide whether it is above the GHC API (import GHC and nothing</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- else) or below it.</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Runtime.Debugger</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Debugger.html#pprintClosureCommand"><span class="hs-identifier">pprintClosureCommand</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Debugger.html#showTerm"><span class="hs-identifier">showTerm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Debugger.html#pprTypeAndContents"><span class="hs-identifier">pprTypeAndContents</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Linker.html"><span class="hs-identifier">GHC.Runtime.Linker</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html"><span class="hs-identifier">GHC.Runtime.Heap.Inspect</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Interpreter.html"><span class="hs-identifier">GHC.Runtime.Interpreter</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#"><span class="hs-identifier">GHCi.RemoteTypes</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html"><span class="hs-identifier">GHC.Driver.Monad</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Syntax.html"><span class="hs-identifier">GHC.Iface.Syntax</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Iface.Syntax.html#showToHeader"><span class="hs-identifier">showToHeader</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html"><span class="hs-identifier">GHC.Iface.Env</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier">newInteractiveBinder</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#varName"><span class="hs-identifier">varName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html"><span class="hs-identifier">GHC.Types.Unique.Set</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.html"><span class="hs-identifier">GHC</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Ppr.TyThing.html"><span class="hs-identifier">GHC.Core.Ppr.TyThing</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Exception.html"><span class="hs-identifier">GHC.Utils.Exception</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#"><span class="hs-identifier">Control.Monad.Catch</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">MC</span></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#%5C%5C"><span class="hs-operator">(\\)</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-comment">-------------------------------------</span><span>
</span><span id="line-49"></span><span class="hs-comment">-- | The :print &amp; friends commands</span><span>
</span><span id="line-50"></span><span class="hs-comment">-------------------------------------</span><span>
</span><span id="line-51"></span><span id="local-6989586621681210587"><span class="annot"><a href="GHC.Runtime.Debugger.html#pprintClosureCommand"><span class="hs-identifier hs-type">pprintClosureCommand</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681210587"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681210587"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-52"></span><span id="pprintClosureCommand"><span class="annot"><span class="annottext">pprintClosureCommand :: forall (m :: * -&gt; *). GhcMonad m =&gt; Bool -&gt; Bool -&gt; String -&gt; m ()
</span><a href="GHC.Runtime.Debugger.html#pprintClosureCommand"><span class="hs-identifier hs-var hs-var">pprintClosureCommand</span></a></span></span><span> </span><span id="local-6989586621681210374"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210374"><span class="hs-identifier hs-var">bindThings</span></a></span></span><span> </span><span id="local-6989586621681210373"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210373"><span class="hs-identifier hs-var">force</span></a></span></span><span> </span><span id="local-6989586621681210372"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210372"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-53"></span><span>  </span><span id="local-6989586621681210371"><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681210371"><span class="hs-identifier hs-var">tythings</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Maybe TyThing] -&gt; [TyThing]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">([Maybe TyThing] -&gt; [TyThing])
-&gt; ([[Maybe TyThing]] -&gt; [Maybe TyThing])
-&gt; [[Maybe TyThing]]
-&gt; [TyThing]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[[Maybe TyThing]] -&gt; [Maybe TyThing]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([[Maybe TyThing]] -&gt; [TyThing])
-&gt; m [[Maybe TyThing]] -&gt; m [TyThing]
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-operator hs-var">`liftM`</span></a></span><span>
</span><span id="line-54"></span><span>                 </span><span class="annot"><span class="annottext">(String -&gt; m [Maybe TyThing]) -&gt; [String] -&gt; m [[Maybe TyThing]]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210365"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210365"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; m [Name]
forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m [Name]
</span><a href="GHC.Runtime.Eval.html#parseName"><span class="hs-identifier hs-var">GHC.parseName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210365"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">m [Name] -&gt; ([Name] -&gt; m [Maybe TyThing]) -&gt; m [Maybe TyThing]
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span>
</span><span id="line-55"></span><span>                                </span><span class="annot"><span class="annottext">(Name -&gt; m (Maybe TyThing)) -&gt; [Name] -&gt; m [Maybe TyThing]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; m (Maybe TyThing)
forall (m :: * -&gt; *). GhcMonad m =&gt; Name -&gt; m (Maybe TyThing)
</span><a href="GHC.html#lookupName"><span class="hs-identifier hs-var">GHC.lookupName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../base/src/Data.OldList.html#words"><span class="hs-identifier hs-var">words</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210372"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210361"><span class="annot"><span class="annottext">ids :: [Id]
</span><a href="#local-6989586621681210361"><span class="hs-identifier hs-var hs-var">ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210360"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AnId"><span class="hs-identifier hs-type">AnId</span></a></span><span> </span><span id="local-6989586621681210360"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210360"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681210371"><span class="hs-identifier hs-var">tythings</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>  </span><span class="hs-comment">-- Obtain the terms and the recovered type information</span><span>
</span><span id="line-60"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681210358"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210358"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210357"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681210357"><span class="hs-identifier hs-var">terms</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(TCvSubst -&gt; Id -&gt; m (TCvSubst, Term))
-&gt; TCvSubst -&gt; [Id] -&gt; m (TCvSubst, [Term])
forall (m :: * -&gt; *) acc x y.
Monad m =&gt;
(acc -&gt; x -&gt; m (acc, y)) -&gt; acc -&gt; [x] -&gt; m (acc, [y])
</span><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier hs-var">mapAccumLM</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; Id -&gt; m (TCvSubst, Term)
forall (m :: * -&gt; *).
GhcMonad m =&gt;
TCvSubst -&gt; Id -&gt; m (TCvSubst, Term)
</span><a href="#local-6989586621681210355"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="GHC.Core.TyCo.Subst.html#emptyTCvSubst"><span class="hs-identifier hs-var">emptyTCvSubst</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681210361"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-comment">-- Apply the substitutions obtained after recovering the types</span><span>
</span><span id="line-63"></span><span>  </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; HscEnv) -&gt; m ()) -&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681210352"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210352"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-64"></span><span>    </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210352"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; TCvSubst -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#substInteractiveContext"><span class="hs-identifier hs-var">substInteractiveContext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210352"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210358"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-comment">-- Finally, print the Terms</span><span>
</span><span id="line-67"></span><span>  </span><span id="local-6989586621681210349"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681210349"><span class="hs-identifier hs-var">unqual</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m PrintUnqualified
forall (m :: * -&gt; *). GhcMonad m =&gt; m PrintUnqualified
</span><a href="GHC.html#getPrintUnqual"><span class="hs-identifier hs-var">GHC.getPrintUnqual</span></a></span><span>
</span><span id="line-68"></span><span>  </span><span id="local-6989586621681210347"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681210347"><span class="hs-identifier hs-var">docterms</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m SDoc) -&gt; [Term] -&gt; m [SDoc]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Term -&gt; m SDoc
forall (m :: * -&gt; *). GhcMonad m =&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Debugger.html#showTerm"><span class="hs-identifier hs-var">showTerm</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681210357"><span class="hs-identifier hs-var">terms</span></a></span><span>
</span><span id="line-69"></span><span>  </span><span id="local-6989586621681210346"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210346"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-70"></span><span>  </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; PrintUnqualified -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#printOutputForUser"><span class="hs-identifier hs-var">printOutputForUser</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210346"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681210349"><span class="hs-identifier hs-var">unqual</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; IO ()) -&gt; ([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; SDoc -&gt; SDoc) -&gt; [Id] -&gt; [SDoc] -&gt; [SDoc]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210340"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210340"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span id="local-6989586621681210339"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681210339"><span class="hs-identifier hs-var">docterm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210340"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681210339"><span class="hs-identifier hs-var">docterm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span>                    </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681210361"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-73"></span><span>                    </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681210347"><span class="hs-identifier hs-var">docterms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-75"></span><span>   </span><span class="hs-comment">-- Do the obtainTerm--bindSuspensions-computeSubstitution dance</span><span>
</span><span id="line-76"></span><span>   </span><span id="local-6989586621681210544"><span class="annot"><a href="#local-6989586621681210355"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681210544"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TCvSubst"><span class="hs-identifier hs-type">TCvSubst</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681210544"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TCvSubst"><span class="hs-identifier hs-type">TCvSubst</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-77"></span><span>   </span><span id="local-6989586621681210355"><span class="annot"><span class="annottext">go :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
TCvSubst -&gt; Id -&gt; m (TCvSubst, Term)
</span><a href="#local-6989586621681210355"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681210308"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210308"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span id="local-6989586621681210307"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210307"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-78"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210304"><span class="annot"><span class="annottext">id' :: Id
</span><a href="#local-6989586621681210304"><span class="hs-identifier hs-var hs-var">id'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Id -&gt; Id
</span><a href="GHC.Types.Var.html#updateIdTypeAndMult"><span class="hs-identifier hs-var">updateIdTypeAndMult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; Type -&gt; Type
TCvSubst -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Subst.html#substTy"><span class="hs-identifier hs-var">substTy</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210308"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210307"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-79"></span><span>           </span><span id="local-6989586621681210301"><span class="annot"><span class="annottext">id_ty' :: Type
</span><a href="#local-6989586621681210301"><span class="hs-identifier hs-var hs-var">id_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210304"><span class="hs-identifier hs-var">id'</span></a></span><span>
</span><span id="line-80"></span><span>       </span><span id="local-6989586621681210299"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210299"><span class="hs-identifier hs-var">term_</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Id -&gt; m Term
forall (m :: * -&gt; *). GhcMonad m =&gt; Int -&gt; Bool -&gt; Id -&gt; m Term
</span><a href="GHC.html#obtainTermFromId"><span class="hs-identifier hs-var">GHC.obtainTermFromId</span></a></span><span> </span><span class="annot"><span class="annottext">Int
forall a. Bounded a =&gt; a
</span><a href="../../base/src/GHC.Enum.html#maxBound"><span class="hs-identifier hs-var">maxBound</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210373"><span class="hs-identifier hs-var">force</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210304"><span class="hs-identifier hs-var">id'</span></a></span><span>
</span><span id="line-81"></span><span>       </span><span id="local-6989586621681210296"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210296"><span class="hs-identifier hs-var">term</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *). GhcMonad m =&gt; Term -&gt; m Term
</span><a href="#local-6989586621681210295"><span class="hs-identifier hs-var">tidyTermTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210299"><span class="hs-identifier hs-var">term_</span></a></span><span>
</span><span id="line-82"></span><span>       </span><span id="local-6989586621681210294"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210294"><span class="hs-identifier hs-var">term'</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681210374"><span class="hs-identifier hs-var">bindThings</span></a></span><span>
</span><span id="line-83"></span><span>                     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *). GhcMonad m =&gt; Term -&gt; m Term
</span><a href="GHC.Runtime.Debugger.html#bindSuspensions"><span class="hs-identifier hs-var">bindSuspensions</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210296"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-84"></span><span>                     </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210296"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-85"></span><span>     </span><span class="hs-comment">-- Before leaving, we compare the type obtained to see if it's more specific</span><span>
</span><span id="line-86"></span><span>     </span><span class="hs-comment">--  Then, we extract a substitution,</span><span>
</span><span id="line-87"></span><span>     </span><span class="hs-comment">--  mapping the old tyvars to the reconstructed types.</span><span>
</span><span id="line-88"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210292"><span class="annot"><span class="annottext">reconstructed_type :: Type
</span><a href="#local-6989586621681210292"><span class="hs-identifier hs-var hs-var">reconstructed_type</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term -&gt; Type
</span><a href="GHC.Runtime.Heap.Inspect.html#termType"><span class="hs-identifier hs-var">termType</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210296"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-89"></span><span>       </span><span id="local-6989586621681210290"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210290"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-90"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; Type -&gt; Type -&gt; Maybe TCvSubst
</span><a href="GHC.Runtime.Heap.Inspect.html#improveRTTIType"><span class="hs-identifier hs-var">improveRTTIType</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210290"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210301"><span class="hs-identifier hs-var">id_ty'</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210292"><span class="hs-identifier hs-var">reconstructed_type</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-91"></span><span>         </span><span class="annot"><span class="annottext">Maybe TCvSubst
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(TCvSubst, Term) -&gt; m (TCvSubst, Term)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210308"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210294"><span class="hs-identifier hs-var">term'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681210287"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210287"><span class="hs-identifier hs-var">subst'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681210286"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210286"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">GHC.getSessionDynFlags</span></a></span><span>
</span><span id="line-93"></span><span>                           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-94"></span><span>                               </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210286"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_rtti"><span class="hs-identifier hs-var">Opt_D_dump_rtti</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RTTI&quot;</span></span><span>
</span><span id="line-95"></span><span>                                 </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatText"><span class="hs-identifier hs-var">FormatText</span></a></span><span>
</span><span id="line-96"></span><span>                                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RTTI Improvement for&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210307"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-97"></span><span>                                  </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;old substitution:&quot;</span></span><span> </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210308"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-98"></span><span>                                  </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;new substitution:&quot;</span></span><span> </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210287"><span class="hs-identifier hs-var">subst'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span>                           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(TCvSubst, Term) -&gt; m (TCvSubst, Term)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210308"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; TCvSubst -&gt; TCvSubst
</span><a href="GHC.Core.TyCo.Subst.html#unionTCvSubst"><span class="hs-operator hs-var">`unionTCvSubst`</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681210287"><span class="hs-identifier hs-var">subst'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210294"><span class="hs-identifier hs-var">term'</span></a></span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>   </span><span id="local-6989586621681210520"><span class="annot"><a href="#local-6989586621681210295"><span class="hs-identifier hs-type">tidyTermTyVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681210520"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681210520"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span></span><span>
</span><span id="line-102"></span><span>   </span><span id="local-6989586621681210295"><span class="annot"><span class="annottext">tidyTermTyVars :: forall (m :: * -&gt; *). GhcMonad m =&gt; Term -&gt; m Term
</span><a href="#local-6989586621681210295"><span class="hs-identifier hs-var hs-var">tidyTermTyVars</span></a></span></span><span> </span><span id="local-6989586621681210271"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210271"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-103"></span><span>     </span><span class="annot"><span class="annottext">(HscEnv -&gt; m Term) -&gt; m Term
forall (m :: * -&gt; *) a. GhcMonad m =&gt; (HscEnv -&gt; m a) -&gt; m a
</span><a href="GHC.Driver.Monad.html#withSession"><span class="hs-identifier hs-var">withSession</span></a></span><span> </span><span class="annot"><span class="annottext">((HscEnv -&gt; m Term) -&gt; m Term) -&gt; (HscEnv -&gt; m Term) -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681210269"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210269"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-104"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210268"><span class="annot"><span class="annottext">env_tvs :: TyCoVarSet
</span><a href="#local-6989586621681210268"><span class="hs-identifier hs-var hs-var">env_tvs</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyThing] -&gt; TyCoVarSet
</span><a href="GHC.Driver.Types.html#tyThingsTyCoVars"><span class="hs-identifier hs-var">tyThingsTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyThing] -&gt; TyCoVarSet) -&gt; [TyThing] -&gt; TyCoVarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [TyThing]
</span><a href="GHC.Driver.Types.html#ic_tythings"><span class="hs-identifier hs-var hs-var">ic_tythings</span></a></span><span> </span><span class="annot"><span class="annottext">(InteractiveContext -&gt; [TyThing])
-&gt; InteractiveContext -&gt; [TyThing]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210269"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-105"></span><span>         </span><span id="local-6989586621681210265"><span class="annot"><span class="annottext">my_tvs :: TyCoVarSet
</span><a href="#local-6989586621681210265"><span class="hs-identifier hs-var hs-var">my_tvs</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Term -&gt; TyCoVarSet
</span><a href="GHC.Runtime.Heap.Inspect.html#termTyCoVars"><span class="hs-identifier hs-var">termTyCoVars</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210271"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-106"></span><span>         </span><span id="local-6989586621681210263"><span class="annot"><span class="annottext">tvs :: TyCoVarSet
</span><a href="#local-6989586621681210263"><span class="hs-identifier hs-var hs-var">tvs</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681210268"><span class="hs-identifier hs-var">env_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#minusVarSet"><span class="hs-operator hs-var">`minusVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681210265"><span class="hs-identifier hs-var">my_tvs</span></a></span><span>
</span><span id="line-107"></span><span>         </span><span id="local-6989586621681210261"><span class="annot"><span class="annottext">tyvarOccName :: Id -&gt; OccName
</span><a href="#local-6989586621681210261"><span class="hs-identifier hs-var hs-var">tyvarOccName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; OccName) -&gt; (Id -&gt; Name) -&gt; Id -&gt; OccName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Var.html#tyVarName"><span class="hs-identifier hs-var">tyVarName</span></a></span><span>
</span><span id="line-108"></span><span>         </span><span id="local-6989586621681210258"><span class="annot"><span class="annottext">tidyEnv :: (TidyOccEnv, UniqFM Id Id)
</span><a href="#local-6989586621681210258"><span class="hs-identifier hs-var hs-var">tidyEnv</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OccName] -&gt; TidyOccEnv
</span><a href="GHC.Types.Name.Occurrence.html#initTidyOccEnv"><span class="hs-identifier hs-var">initTidyOccEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; OccName) -&gt; [Id] -&gt; [OccName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; OccName
</span><a href="#local-6989586621681210261"><span class="hs-identifier hs-var">tyvarOccName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVarSet -&gt; [Id]
forall elt. UniqSet elt -&gt; [elt]
</span><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier hs-var">nonDetEltsUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681210263"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span>           </span><span class="hs-comment">-- It's OK to use nonDetEltsUniqSet here because initTidyOccEnv</span><span>
</span><span id="line-110"></span><span>           </span><span class="hs-comment">-- forgets the ordering immediately by creating an env</span><span>
</span><span id="line-111"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCoVarSet -&gt; UniqFM Id Id
forall a. UniqSet a -&gt; UniqFM a a
</span><a href="GHC.Types.Unique.Set.html#getUniqSet"><span class="hs-identifier hs-var">getUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">(TyCoVarSet -&gt; UniqFM Id Id) -&gt; TyCoVarSet -&gt; UniqFM Id Id
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681210268"><span class="hs-identifier hs-var">env_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet -&gt; TyCoVarSet -&gt; TyCoVarSet
</span><a href="GHC.Types.Var.Set.html#intersectVarSet"><span class="hs-operator hs-var">`intersectVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarSet
</span><a href="#local-6989586621681210265"><span class="hs-identifier hs-var">my_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span>     </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Term -&gt; m Term) -&gt; Term -&gt; m Term
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#mapTermType"><span class="hs-identifier hs-var">mapTermType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((TidyOccEnv, UniqFM Id Id), Type) -&gt; Type
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">(((TidyOccEnv, UniqFM Id Id), Type) -&gt; Type)
-&gt; (Type -&gt; ((TidyOccEnv, UniqFM Id Id), Type)) -&gt; Type -&gt; Type
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(TidyOccEnv, UniqFM Id Id)
-&gt; Type -&gt; ((TidyOccEnv, UniqFM Id Id), Type)
</span><a href="GHC.Core.TyCo.Tidy.html#tidyOpenType"><span class="hs-identifier hs-var">tidyOpenType</span></a></span><span> </span><span class="annot"><span class="annottext">(TidyOccEnv, UniqFM Id Id)
</span><a href="#local-6989586621681210258"><span class="hs-identifier hs-var">tidyEnv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210271"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="hs-comment">-- | Give names, and bind in the interactive environment, to all the suspensions</span><span>
</span><span id="line-115"></span><span class="hs-comment">--   included (inductively) in a term</span><span>
</span><span id="line-116"></span><span id="local-6989586621681210251"><span class="annot"><a href="GHC.Runtime.Debugger.html#bindSuspensions"><span class="hs-identifier hs-type">bindSuspensions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681210251"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681210251"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span></span><span>
</span><span id="line-117"></span><span id="bindSuspensions"><span class="annot"><span class="annottext">bindSuspensions :: forall (m :: * -&gt; *). GhcMonad m =&gt; Term -&gt; m Term
</span><a href="GHC.Runtime.Debugger.html#bindSuspensions"><span class="hs-identifier hs-var hs-var">bindSuspensions</span></a></span></span><span> </span><span id="local-6989586621681210220"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210220"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-118"></span><span>      </span><span id="local-6989586621681210219"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210219"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-119"></span><span>      </span><span id="local-6989586621681210218"><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681210218"><span class="hs-identifier hs-var">inScope</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m [TyThing]
forall (m :: * -&gt; *). GhcMonad m =&gt; m [TyThing]
</span><a href="GHC.html#getBindings"><span class="hs-identifier hs-var">GHC.getBindings</span></a></span><span>
</span><span id="line-120"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210216"><span class="annot"><span class="annottext">ictxt :: InteractiveContext
</span><a href="#local-6989586621681210216"><span class="hs-identifier hs-var hs-var">ictxt</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210219"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-121"></span><span>          </span><span id="local-6989586621681210215"><span class="annot"><span class="annottext">prefix :: String
</span><a href="#local-6989586621681210215"><span class="hs-identifier hs-var hs-var">prefix</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_t&quot;</span></span><span>
</span><span id="line-122"></span><span>          </span><span id="local-6989586621681210212"><span class="annot"><span class="annottext">alreadyUsedNames :: [String]
</span><a href="#local-6989586621681210212"><span class="hs-identifier hs-var hs-var">alreadyUsedNames</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyThing -&gt; String) -&gt; [TyThing] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; String
</span><a href="GHC.Types.Name.Occurrence.html#occNameString"><span class="hs-identifier hs-var">occNameString</span></a></span><span> </span><span class="annot"><span class="annottext">(OccName -&gt; String) -&gt; (TyThing -&gt; OccName) -&gt; TyThing -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; OccName) -&gt; (TyThing -&gt; Name) -&gt; TyThing -&gt; OccName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyThing -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TyThing]
</span><a href="#local-6989586621681210218"><span class="hs-identifier hs-var">inScope</span></a></span><span>
</span><span id="line-123"></span><span>          </span><span id="local-6989586621681210201"><span class="annot"><span class="annottext">availNames :: [String]
</span><a href="#local-6989586621681210201"><span class="hs-identifier hs-var hs-var">availNames</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; String) -&gt; [Int] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210215"><span class="hs-identifier hs-var">prefix</span></a></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (Int -&gt; String) -&gt; Int -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-glyph">::</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span class="hs-glyph">..</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#%5C%5C"><span class="hs-operator hs-var">\\</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621681210212"><span class="hs-identifier hs-var">alreadyUsedNames</span></a></span><span>
</span><span id="line-124"></span><span>      </span><span id="local-6989586621681210199"><span class="annot"><span class="annottext">IORef [String]
</span><a href="#local-6989586621681210199"><span class="hs-identifier hs-var">availNames_var</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (IORef [String]) -&gt; m (IORef [String])
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (IORef [String]) -&gt; m (IORef [String]))
-&gt; IO (IORef [String]) -&gt; m (IORef [String])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO (IORef [String])
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621681210201"><span class="hs-identifier hs-var">availNames</span></a></span><span>
</span><span id="line-125"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681210197"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210197"><span class="hs-identifier hs-var">t'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210196"><span class="annot"><span class="annottext">[(Name, Type, ForeignHValue)]
</span><a href="#local-6989586621681210196"><span class="hs-identifier hs-var">stuff</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Term, [(Name, Type, ForeignHValue)])
-&gt; m (Term, [(Name, Type, ForeignHValue)])
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Term, [(Name, Type, ForeignHValue)])
 -&gt; m (Term, [(Name, Type, ForeignHValue)]))
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
-&gt; m (Term, [(Name, Type, ForeignHValue)])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TermFold (IO (Term, [(Name, Type, ForeignHValue)]))
-&gt; Term -&gt; IO (Term, [(Name, Type, ForeignHValue)])
forall a. TermFold a -&gt; Term -&gt; a
</span><a href="GHC.Runtime.Heap.Inspect.html#foldTerm"><span class="hs-identifier hs-var">foldTerm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv
-&gt; IORef [String]
-&gt; TermFold (IO (Term, [(Name, Type, ForeignHValue)]))
</span><a href="#local-6989586621681210194"><span class="hs-identifier hs-var">nameSuspensionsAndGetInfos</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210219"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [String]
</span><a href="#local-6989586621681210199"><span class="hs-identifier hs-var">availNames_var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210220"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-126"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681210193"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681210193"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210192"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681210192"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210191"><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681210191"><span class="hs-identifier hs-var">fhvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Type, ForeignHValue)] -&gt; ([Name], [Type], [ForeignHValue])
forall a b c. [(a, b, c)] -&gt; ([a], [b], [c])
</span><a href="../../base/src/GHC.List.html#unzip3"><span class="hs-identifier hs-var">unzip3</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Type, ForeignHValue)]
</span><a href="#local-6989586621681210196"><span class="hs-identifier hs-var">stuff</span></a></span><span>
</span><span id="line-127"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210189"><span class="annot"><span class="annottext">ids :: [Id]
</span><a href="#local-6989586621681210189"><span class="hs-identifier hs-var hs-var">ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobal"><span class="hs-identifier hs-var">mkVanillaGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210187"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210186"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-128"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681210187"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210187"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681210186"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210186"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [Type] -&gt; [(Name, Type)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681210193"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681210192"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-129"></span><span>          </span><span id="local-6989586621681210185"><span class="annot"><span class="annottext">new_ic :: InteractiveContext
</span><a href="#local-6989586621681210185"><span class="hs-identifier hs-var hs-var">new_ic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Id] -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#extendInteractiveContextWithIds"><span class="hs-identifier hs-var">extendInteractiveContextWithIds</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681210216"><span class="hs-identifier hs-var">ictxt</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681210189"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-130"></span><span>          </span><span id="local-6989586621681210183"><span class="annot"><span class="annottext">dl :: DynLinker
</span><a href="#local-6989586621681210183"><span class="hs-identifier hs-var hs-var">dl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynLinker
</span><a href="GHC.Driver.Types.html#hsc_dynLinker"><span class="hs-identifier hs-var hs-var">hsc_dynLinker</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210219"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-131"></span><span>      </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker -&gt; [(Name, ForeignHValue)] -&gt; IO ()
</span><a href="GHC.Runtime.Linker.html#extendLinkEnv"><span class="hs-identifier hs-var">extendLinkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker
</span><a href="#local-6989586621681210183"><span class="hs-identifier hs-var">dl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; [ForeignHValue] -&gt; [(Name, ForeignHValue)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681210193"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignHValue]
</span><a href="#local-6989586621681210191"><span class="hs-identifier hs-var">fhvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-132"></span><span>      </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210219"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681210185"><span class="hs-identifier hs-var">new_ic</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-133"></span><span>      </span><span class="annot"><span class="annottext">Term -&gt; m Term
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210197"><span class="hs-identifier hs-var">t'</span></a></span><span>
</span><span id="line-134"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-comment">--    Processing suspensions. Give names and recopilate info</span><span>
</span><span id="line-137"></span><span>        </span><span class="annot"><a href="#local-6989586621681210194"><span class="hs-identifier hs-type">nameSuspensionsAndGetInfos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-138"></span><span>                                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-type">TermFold</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignHValue"><span class="hs-identifier hs-type">ForeignHValue</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>        </span><span id="local-6989586621681210194"><span class="annot"><span class="annottext">nameSuspensionsAndGetInfos :: HscEnv
-&gt; IORef [String]
-&gt; TermFold (IO (Term, [(Name, Type, ForeignHValue)]))
</span><a href="#local-6989586621681210194"><span class="hs-identifier hs-var hs-var">nameSuspensionsAndGetInfos</span></a></span></span><span> </span><span id="local-6989586621681210179"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210179"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681210178"><span class="annot"><span class="annottext">IORef [String]
</span><a href="#local-6989586621681210178"><span class="hs-identifier hs-var">freeNames</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermFold :: forall a.
TermProcessor a a
-&gt; (Type -&gt; [Word] -&gt; a)
-&gt; (ClosureType -&gt; Type -&gt; ForeignHValue -&gt; Maybe Name -&gt; a)
-&gt; (Type -&gt; Either String DataCon -&gt; a -&gt; a)
-&gt; (Type -&gt; a -&gt; a)
-&gt; TermFold a
</span><a href="GHC.Runtime.Heap.Inspect.html#TermFold"><span class="hs-identifier hs-type">TermFold</span></a></span><span>
</span><span id="line-140"></span><span>                      </span><span class="hs-special">{</span><span>
</span><span id="line-141"></span><span>                        </span><span class="annot"><span class="annottext">fSuspension :: ClosureType
-&gt; Type
-&gt; ForeignHValue
-&gt; Maybe Name
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="GHC.Runtime.Heap.Inspect.html#fSuspension"><span class="hs-identifier hs-var">fSuspension</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; IORef [String]
-&gt; ClosureType
-&gt; Type
-&gt; ForeignHValue
-&gt; Maybe Name
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
forall {p}.
HscEnv
-&gt; IORef [String]
-&gt; ClosureType
-&gt; Type
-&gt; ForeignHValue
-&gt; p
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="#local-6989586621681210175"><span class="hs-identifier hs-var">doSuspension</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210179"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [String]
</span><a href="#local-6989586621681210178"><span class="hs-identifier hs-var">freeNames</span></a></span><span>
</span><span id="line-142"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fTerm :: TermProcessor
  (IO (Term, [(Name, Type, ForeignHValue)]))
  (IO (Term, [(Name, Type, ForeignHValue)]))
</span><a href="GHC.Runtime.Heap.Inspect.html#fTerm"><span class="hs-identifier hs-var">fTerm</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681210173"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210173"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681210172"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681210172"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681210171"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210171"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681210170"><span class="annot"><span class="annottext">[IO (Term, [(Name, Type, ForeignHValue)])]
</span><a href="#local-6989586621681210170"><span class="hs-identifier hs-var">tt</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-143"></span><span>                                    </span><span id="local-6989586621681210169"><span class="annot"><span class="annottext">[(Term, [(Name, Type, ForeignHValue)])]
</span><a href="#local-6989586621681210169"><span class="hs-identifier hs-var">tt'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[IO (Term, [(Name, Type, ForeignHValue)])]
-&gt; IO [(Term, [(Name, Type, ForeignHValue)])]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="annot"><span class="annottext">[IO (Term, [(Name, Type, ForeignHValue)])]
</span><a href="#local-6989586621681210170"><span class="hs-identifier hs-var">tt</span></a></span><span>
</span><span id="line-144"></span><span>                                    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681210167"><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681210167"><span class="hs-identifier hs-var">terms</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681210166"><span class="annot"><span class="annottext">[[(Name, Type, ForeignHValue)]]
</span><a href="#local-6989586621681210166"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Term, [(Name, Type, ForeignHValue)])]
-&gt; ([Term], [[(Name, Type, ForeignHValue)]])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(Term, [(Name, Type, ForeignHValue)])]
</span><a href="#local-6989586621681210169"><span class="hs-identifier hs-var">tt'</span></a></span><span>
</span><span id="line-145"></span><span>                                    </span><span class="annot"><span class="annottext">(Term, [(Name, Type, ForeignHValue)])
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Either String DataCon -&gt; ForeignHValue -&gt; [Term] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-var">Term</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210173"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681210172"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210171"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">[Term]
</span><a href="#local-6989586621681210167"><span class="hs-identifier hs-var">terms</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[[(Name, Type, ForeignHValue)]] -&gt; [(Name, Type, ForeignHValue)]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[(Name, Type, ForeignHValue)]]
</span><a href="#local-6989586621681210166"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fPrim :: Type -&gt; [Word] -&gt; IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="GHC.Runtime.Heap.Inspect.html#fPrim"><span class="hs-identifier hs-var">fPrim</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681210162"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210162"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681210161"><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681210161"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span class="annot"><span class="annottext">(Term, [(Name, Type, ForeignHValue)])
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; [Word] -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Prim"><span class="hs-identifier hs-var">Prim</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210162"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Word]
</span><a href="#local-6989586621681210161"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fNewtypeWrap :: Type
-&gt; Either String DataCon
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="GHC.Runtime.Heap.Inspect.html#fNewtypeWrap"><span class="hs-identifier hs-var">fNewtypeWrap</span></a></span><span>  </span><span class="hs-glyph">=</span><span>
</span><span id="line-148"></span><span>                                </span><span class="hs-glyph">\</span><span id="local-6989586621681210158"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210158"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681210157"><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681210157"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621681210156"><span class="annot"><span class="annottext">IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="#local-6989586621681210156"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-149"></span><span>                                    </span><span class="hs-special">(</span><span id="local-6989586621681210155"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210155"><span class="hs-identifier hs-var">term</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210154"><span class="annot"><span class="annottext">[(Name, Type, ForeignHValue)]
</span><a href="#local-6989586621681210154"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="#local-6989586621681210156"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-150"></span><span>                                    </span><span class="annot"><span class="annottext">(Term, [(Name, Type, ForeignHValue)])
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Either String DataCon -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-var">NewtypeWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210158"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Either String DataCon
</span><a href="#local-6989586621681210157"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210155"><span class="hs-identifier hs-var">term</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Name, Type, ForeignHValue)]
</span><a href="#local-6989586621681210154"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fRefWrap :: Type
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="GHC.Runtime.Heap.Inspect.html#fRefWrap"><span class="hs-identifier hs-var">fRefWrap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681210151"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210151"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681210150"><span class="annot"><span class="annottext">IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="#local-6989586621681210150"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-152"></span><span>                                    </span><span class="hs-special">(</span><span id="local-6989586621681210149"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210149"><span class="hs-identifier hs-var">term</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210148"><span class="annot"><span class="annottext">[(Name, Type, ForeignHValue)]
</span><a href="#local-6989586621681210148"><span class="hs-identifier hs-var">names</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="#local-6989586621681210150"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-153"></span><span>                                    </span><span class="annot"><span class="annottext">(Term, [(Name, Type, ForeignHValue)])
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#RefWrap"><span class="hs-identifier hs-var">RefWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210151"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210149"><span class="hs-identifier hs-var">term</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Name, Type, ForeignHValue)]
</span><a href="#local-6989586621681210148"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>                      </span><span class="hs-special">}</span><span>
</span><span id="line-155"></span><span>        </span><span id="local-6989586621681210175"><span class="annot"><span class="annottext">doSuspension :: HscEnv
-&gt; IORef [String]
-&gt; ClosureType
-&gt; Type
-&gt; ForeignHValue
-&gt; p
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
</span><a href="#local-6989586621681210175"><span class="hs-identifier hs-var hs-var">doSuspension</span></a></span></span><span> </span><span id="local-6989586621681210141"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210141"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681210140"><span class="annot"><span class="annottext">IORef [String]
</span><a href="#local-6989586621681210140"><span class="hs-identifier hs-var">freeNames</span></a></span></span><span> </span><span id="local-6989586621681210139"><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681210139"><span class="hs-identifier hs-var">ct</span></a></span></span><span> </span><span id="local-6989586621681210138"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210138"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681210137"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210137"><span class="hs-identifier hs-var">hval</span></a></span></span><span> </span><span id="local-6989586621681210136"><span class="annot"><span class="annottext">p
</span><a href="#local-6989586621681210136"><span class="hs-identifier hs-var">_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-156"></span><span>          </span><span id="local-6989586621681210135"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210135"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef [String] -&gt; ([String] -&gt; ([String], String)) -&gt; IO String
forall a b. IORef a -&gt; (a -&gt; (a, b)) -&gt; IO b
</span><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier hs-var">atomicModifyIORef'</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [String]
</span><a href="#local-6989586621681210140"><span class="hs-identifier hs-var">freeNames</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210133"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621681210133"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-glyph">-&gt;</span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621681210133"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621681210133"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span>          </span><span id="local-6989586621681210130"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210130"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; String -&gt; IO Name
forall (m :: * -&gt; *). MonadIO m =&gt; HscEnv -&gt; String -&gt; m Name
</span><a href="GHC.Runtime.Debugger.html#newGrimName"><span class="hs-identifier hs-var">newGrimName</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210141"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210135"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-158"></span><span>          </span><span class="annot"><span class="annottext">(Term, [(Name, Type, ForeignHValue)])
-&gt; IO (Term, [(Name, Type, ForeignHValue)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ClosureType -&gt; Type -&gt; ForeignHValue -&gt; Maybe Name -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#Suspension"><span class="hs-identifier hs-var">Suspension</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureType
</span><a href="#local-6989586621681210139"><span class="hs-identifier hs-var">ct</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210138"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210137"><span class="hs-identifier hs-var">hval</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210130"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210130"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210138"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210137"><span class="hs-identifier hs-var">hval</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span class="hs-comment">--  A custom Term printer to enable the use of Show instances</span><span>
</span><span id="line-162"></span><span id="local-6989586621681210534"><span class="annot"><a href="GHC.Runtime.Debugger.html#showTerm"><span class="hs-identifier hs-type">showTerm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681210534"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681210534"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-163"></span><span id="showTerm"><span class="annot"><span class="annottext">showTerm :: forall (m :: * -&gt; *). GhcMonad m =&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Debugger.html#showTerm"><span class="hs-identifier hs-var hs-var">showTerm</span></a></span></span><span> </span><span id="local-6989586621681210109"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210109"><span class="hs-identifier hs-var">term</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-164"></span><span>    </span><span id="local-6989586621681210108"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210108"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">GHC.getSessionDynFlags</span></a></span><span>
</span><span id="line-165"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_PrintEvldWithShow"><span class="hs-identifier hs-var">Opt_PrintEvldWithShow</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210108"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-166"></span><span>       </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CustomTermPrinter m -&gt; Term -&gt; m SDoc
forall (m :: * -&gt; *).
Monad m =&gt;
CustomTermPrinter m -&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTerm"><span class="hs-identifier hs-var">cPprTerm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([Int -&gt; Term -&gt; m (Maybe SDoc)]
 -&gt; [Int -&gt; Term -&gt; m (Maybe SDoc)]
 -&gt; [Int -&gt; Term -&gt; m (Maybe SDoc)])
-&gt; CustomTermPrinter m
-&gt; CustomTermPrinter m
-&gt; CustomTermPrinter m
forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM2"><span class="hs-identifier hs-var">liftM2</span></a></span><span> </span><span class="annot"><span class="annottext">[Int -&gt; Term -&gt; m (Maybe SDoc)]
-&gt; [Int -&gt; Term -&gt; m (Maybe SDoc)]
-&gt; [Int -&gt; Term -&gt; m (Maybe SDoc)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">(++)</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681210103"><span class="annot"><span class="annottext">TermPrinterM m
</span><a href="#local-6989586621681210103"><span class="hs-identifier hs-var">_y</span></a></span></span><span class="hs-glyph">-&gt;</span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int -&gt; Term -&gt; m (Maybe SDoc)
forall {m :: * -&gt; *} {t}.
(GhcMonad m, Ord t, Num t) =&gt;
t -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681210102"><span class="hs-identifier hs-var">cPprShowable</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CustomTermPrinter m
forall (m :: * -&gt; *). Monad m =&gt; CustomTermPrinter m
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTermBase"><span class="hs-identifier hs-var">cPprTermBase</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210109"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-167"></span><span>       </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">CustomTermPrinter m -&gt; Term -&gt; m SDoc
forall (m :: * -&gt; *).
Monad m =&gt;
CustomTermPrinter m -&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTerm"><span class="hs-identifier hs-var">cPprTerm</span></a></span><span> </span><span class="annot"><span class="annottext">CustomTermPrinter m
forall (m :: * -&gt; *). Monad m =&gt; CustomTermPrinter m
</span><a href="GHC.Runtime.Heap.Inspect.html#cPprTermBase"><span class="hs-identifier hs-var">cPprTermBase</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210109"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-168"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-169"></span><span>  </span><span id="local-6989586621681210102"><span class="annot"><span class="annottext">cPprShowable :: t -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681210102"><span class="hs-identifier hs-var hs-var">cPprShowable</span></a></span></span><span> </span><span id="local-6989586621681210062"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681210062"><span class="hs-identifier hs-var">prec</span></a></span></span><span> </span><span id="local-6989586621681210061"><span class="annot"><span class="annottext">t :: Term
</span><a href="#local-6989586621681210061"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#Term"><span class="hs-identifier hs-type">Term</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ty :: Term -&gt; Type
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681210059"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210059"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">val :: Term -&gt; ForeignHValue
</span><a href="GHC.Runtime.Heap.Inspect.html#val"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681210057"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210057"><span class="hs-identifier hs-var">fhv</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Term -&gt; Bool
</span><a href="GHC.Runtime.Heap.Inspect.html#isFullyEvaluatedTerm"><span class="hs-identifier hs-var">isFullyEvaluatedTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210061"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-172"></span><span>     </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-173"></span><span>        </span><span id="local-6989586621681210054"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210054"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-174"></span><span>        </span><span id="local-6989586621681210053"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210053"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">GHC.getSessionDynFlags</span></a></span><span>
</span><span id="line-175"></span><span>        </span><span class="hs-keyword">do</span><span>
</span><span id="line-176"></span><span>           </span><span class="hs-special">(</span><span id="local-6989586621681210052"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210052"><span class="hs-identifier hs-var">new_env</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681210051"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210051"><span class="hs-identifier hs-var">bname</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Type -&gt; String -&gt; m (HscEnv, Name)
forall {m :: * -&gt; *}.
MonadIO m =&gt;
HscEnv -&gt; Type -&gt; String -&gt; m (HscEnv, Name)
</span><a href="#local-6989586621681210050"><span class="hs-identifier hs-var">bindToFreshName</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210054"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210059"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;showme&quot;</span></span><span>
</span><span id="line-177"></span><span>           </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210052"><span class="hs-identifier hs-var">new_env</span></a></span><span>
</span><span id="line-178"></span><span>                      </span><span class="hs-comment">-- XXX: this tries to disable logging of errors</span><span>
</span><span id="line-179"></span><span>                      </span><span class="hs-comment">-- does this still do what it is intended to do</span><span>
</span><span id="line-180"></span><span>                      </span><span class="hs-comment">-- with the changed error handling and logging?</span><span>
</span><span id="line-181"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210047"><span class="annot"><span class="annottext">noop_log :: p -&gt; p -&gt; p -&gt; p -&gt; p -&gt; m ()
</span><a href="#local-6989586621681210047"><span class="hs-identifier hs-var hs-var">noop_log</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>               </span><span id="local-6989586621681210044"><span class="annot"><span class="annottext">expr :: String
</span><a href="#local-6989586621681210044"><span class="hs-identifier hs-var hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Prelude.return (Prelude.show &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-183"></span><span>                         </span><span class="annot"><span class="annottext">DynFlags -&gt; Name -&gt; String
forall a. Outputable a =&gt; DynFlags -&gt; a -&gt; String
</span><a href="GHC.Utils.Outputable.html#showPpr"><span class="hs-identifier hs-var">showPpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210053"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210051"><span class="hs-identifier hs-var">bname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-184"></span><span>                      </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;) :: Prelude.IO Prelude.String&quot;</span></span><span>
</span><span id="line-185"></span><span>               </span><span id="local-6989586621681210042"><span class="annot"><span class="annottext">dl :: DynLinker
</span><a href="#local-6989586621681210042"><span class="hs-identifier hs-var hs-var">dl</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynLinker
</span><a href="GHC.Driver.Types.html#hsc_dynLinker"><span class="hs-identifier hs-var hs-var">hsc_dynLinker</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210054"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-186"></span><span>           </span><span class="annot"><span class="annottext">DynFlags -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier hs-var">GHC.setSessionDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210053"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">log_action :: LogAction
</span><a href="#local-6989586621681210040"><span class="hs-identifier hs-var">log_action</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">LogAction
forall {m :: * -&gt; *} {p} {p} {p} {p} {p}.
Monad m =&gt;
p -&gt; p -&gt; p -&gt; p -&gt; p -&gt; m ()
</span><a href="#local-6989586621681210047"><span class="hs-identifier hs-var">noop_log</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-187"></span><span>           </span><span id="local-6989586621681210039"><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210039"><span class="hs-identifier hs-var">txt_</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynLinker
-&gt; [(Name, ForeignHValue)] -&gt; m ForeignHValue -&gt; m ForeignHValue
forall (m :: * -&gt; *) a.
ExceptionMonad m =&gt;
DynLinker -&gt; [(Name, ForeignHValue)] -&gt; m a -&gt; m a
</span><a href="GHC.Runtime.Linker.html#withExtendedLinkEnv"><span class="hs-identifier hs-var">withExtendedLinkEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DynLinker
</span><a href="#local-6989586621681210042"><span class="hs-identifier hs-var">dl</span></a></span><span>
</span><span id="line-188"></span><span>                                       </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210051"><span class="hs-identifier hs-var">bname</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210057"><span class="hs-identifier hs-var">fhv</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-189"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; m ForeignHValue
forall (m :: * -&gt; *). GhcMonad m =&gt; String -&gt; m ForeignHValue
</span><a href="GHC.Runtime.Eval.html#compileExprRemote"><span class="hs-identifier hs-var">GHC.compileExprRemote</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210044"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210035"><span class="annot"><span class="annottext">myprec :: t
</span><a href="#local-6989586621681210035"><span class="hs-identifier hs-var hs-var">myprec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t
</span><span class="hs-number">10</span></span><span> </span><span class="hs-comment">-- application precedence. TODO Infix constructors</span><span>
</span><span id="line-191"></span><span>           </span><span id="local-6989586621681210034"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210034"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO String -&gt; m String
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO String -&gt; m String) -&gt; IO String -&gt; m String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ForeignHValue -&gt; IO String
</span><a href="GHC.Runtime.Interpreter.html#evalString"><span class="hs-identifier hs-var">evalString</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210054"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHValue
</span><a href="#local-6989586621681210039"><span class="hs-identifier hs-var">txt_</span></a></span><span>
</span><span id="line-192"></span><span>           </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210034"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-193"></span><span>             </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe SDoc -&gt; m (Maybe SDoc)) -&gt; Maybe SDoc -&gt; m (Maybe SDoc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; Maybe SDoc) -&gt; SDoc -&gt; Maybe SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#cparen"><span class="hs-identifier hs-var">cparen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681210062"><span class="hs-identifier hs-var">prec</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; t -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681210035"><span class="hs-identifier hs-var">myprec</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
</span><a href="#local-6989586621681210029"><span class="hs-identifier hs-var">needsParens</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210034"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-194"></span><span>                                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210034"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-196"></span><span>         </span><span class="annot"><span class="annottext">m (Maybe SDoc) -&gt; m () -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a b. MonadMask m =&gt; m a -&gt; m b -&gt; m a
</span><a href="../../exceptions/src/Control.Monad.Catch.html#finally"><span class="hs-operator hs-var">`MC.finally`</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-197"></span><span>           </span><span class="annot"><span class="annottext">HscEnv -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; HscEnv -&gt; m ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var">setSession</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210054"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-198"></span><span>           </span><span class="annot"><span class="annottext">DynFlags -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier hs-var">GHC.setSessionDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681210053"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-199"></span><span>  </span><span class="annot"><a href="#local-6989586621681210102"><span class="hs-identifier hs-var">cPprShowable</span></a></span><span> </span><span id="local-6989586621681210027"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681210027"><span class="hs-identifier hs-var">prec</span></a></span></span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Inspect.html#NewtypeWrap"><span class="hs-identifier hs-type">NewtypeWrap</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ty :: Term -&gt; Type
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681210026"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210026"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">wrapped_term :: Term -&gt; Term
</span><a href="GHC.Runtime.Heap.Inspect.html#wrapped_term"><span class="hs-identifier hs-var">wrapped_term</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681210024"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210024"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-200"></span><span>      </span><span class="annot"><span class="annottext">t -&gt; Term -&gt; m (Maybe SDoc)
</span><a href="#local-6989586621681210102"><span class="hs-identifier hs-var">cPprShowable</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681210027"><span class="hs-identifier hs-var">prec</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681210024"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">ty :: Type
</span><a href="GHC.Runtime.Heap.Inspect.html#ty"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210026"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-201"></span><span>  </span><span class="annot"><a href="#local-6989586621681210102"><span class="hs-identifier hs-var">cPprShowable</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Term
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SDoc -&gt; m (Maybe SDoc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SDoc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span>  </span><span id="local-6989586621681210029"><span class="annot"><span class="annottext">needsParens :: String -&gt; Bool
</span><a href="#local-6989586621681210029"><span class="hs-identifier hs-var hs-var">needsParens</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>   </span><span class="hs-comment">-- some simple heuristics to see whether parens</span><span>
</span><span id="line-204"></span><span>                                </span><span class="hs-comment">-- are redundant in an arbitrary Show output</span><span>
</span><span id="line-205"></span><span>  </span><span class="annot"><a href="#local-6989586621681210029"><span class="hs-identifier hs-var">needsParens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-206"></span><span>  </span><span class="annot"><a href="#local-6989586621681210029"><span class="hs-identifier hs-var">needsParens</span></a></span><span> </span><span id="local-6989586621681210021"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210021"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210021"><span class="hs-identifier hs-var">txt</span></a></span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span>  </span><span id="local-6989586621681210050"><span class="annot"><span class="annottext">bindToFreshName :: HscEnv -&gt; Type -&gt; String -&gt; m (HscEnv, Name)
</span><a href="#local-6989586621681210050"><span class="hs-identifier hs-var hs-var">bindToFreshName</span></a></span></span><span> </span><span id="local-6989586621681210013"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210013"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681210012"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210012"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681210011"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210011"><span class="hs-identifier hs-var">userName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-210"></span><span>    </span><span id="local-6989586621681210010"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210010"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; String -&gt; m Name
forall (m :: * -&gt; *). MonadIO m =&gt; HscEnv -&gt; String -&gt; m Name
</span><a href="GHC.Runtime.Debugger.html#newGrimName"><span class="hs-identifier hs-var">newGrimName</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210013"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210011"><span class="hs-identifier hs-var">userName</span></a></span><span>
</span><span id="line-211"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681210009"><span class="annot"><span class="annottext">id :: Id
</span><a href="#local-6989586621681210009"><span class="hs-identifier hs-var hs-var">id</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkVanillaGlobal"><span class="hs-identifier hs-var">mkVanillaGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210010"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681210012"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-212"></span><span>        </span><span id="local-6989586621681210008"><span class="annot"><span class="annottext">new_ic :: InteractiveContext
</span><a href="#local-6989586621681210008"><span class="hs-identifier hs-var hs-var">new_ic</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; [Id] -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#extendInteractiveContextWithIds"><span class="hs-identifier hs-var">extendInteractiveContextWithIds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210013"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681210009"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-213"></span><span>    </span><span class="annot"><span class="annottext">(HscEnv, Name) -&gt; m (HscEnv, Name)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210013"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_IC :: InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var">hsc_IC</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext
</span><a href="#local-6989586621681210008"><span class="hs-identifier hs-var">new_ic</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681210010"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="hs-comment">--    Create new uniques and give them sequentially numbered names</span><span>
</span><span id="line-216"></span><span id="local-6989586621681210468"><span class="annot"><a href="GHC.Runtime.Debugger.html#newGrimName"><span class="hs-identifier hs-type">newGrimName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681210468"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681210468"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span></span><span>
</span><span id="line-217"></span><span id="newGrimName"><span class="annot"><span class="annottext">newGrimName :: forall (m :: * -&gt; *). MonadIO m =&gt; HscEnv -&gt; String -&gt; m Name
</span><a href="GHC.Runtime.Debugger.html#newGrimName"><span class="hs-identifier hs-var hs-var">newGrimName</span></a></span></span><span> </span><span id="local-6989586621681210005"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210005"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681210004"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210004"><span class="hs-identifier hs-var">userName</span></a></span></span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Name -&gt; m Name
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; OccName -&gt; SrcSpan -&gt; IO Name
</span><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier hs-var">newInteractiveBinder</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681210005"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681210003"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-220"></span><span>    </span><span id="local-6989586621681210003"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681210003"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; String -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkOccName"><span class="hs-identifier hs-var">mkOccName</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier hs-var">varName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681210004"><span class="hs-identifier hs-var">userName</span></a></span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span id="local-6989586621681210430"><span class="annot"><a href="GHC.Runtime.Debugger.html#pprTypeAndContents"><span class="hs-identifier hs-type">pprTypeAndContents</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681210430"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681210430"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-223"></span><span id="pprTypeAndContents"><span class="annot"><span class="annottext">pprTypeAndContents :: forall (m :: * -&gt; *). GhcMonad m =&gt; Id -&gt; m SDoc
</span><a href="GHC.Runtime.Debugger.html#pprTypeAndContents"><span class="hs-identifier hs-var hs-var">pprTypeAndContents</span></a></span></span><span> </span><span id="local-6989586621681209980"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681209980"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-224"></span><span>  </span><span id="local-6989586621681209979"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681209979"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">GHC.getSessionDynFlags</span></a></span><span>
</span><span id="line-225"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681209978"><span class="annot"><span class="annottext">pcontents :: Bool
</span><a href="#local-6989586621681209978"><span class="hs-identifier hs-var hs-var">pcontents</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_PrintBindContents"><span class="hs-identifier hs-var">Opt_PrintBindContents</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681209979"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-226"></span><span>      </span><span id="local-6989586621681209976"><span class="annot"><span class="annottext">pprdId :: SDoc
</span><a href="#local-6989586621681209976"><span class="hs-identifier hs-var hs-var">pprdId</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShowSub -&gt; TyThing -&gt; SDoc
</span><a href="GHC.Core.Ppr.TyThing.html#pprTyThing"><span class="hs-identifier hs-var">pprTyThing</span></a></span><span> </span><span class="annot"><span class="annottext">ShowSub
</span><a href="GHC.Iface.Syntax.html#showToHeader"><span class="hs-identifier hs-var">showToHeader</span></a></span><span> </span><span class="annot"><span class="annottext">(TyThing -&gt; SDoc) -&gt; (Id -&gt; TyThing) -&gt; Id -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; TyThing
</span><a href="GHC.Core.TyCo.Rep.html#AnId"><span class="hs-identifier hs-var">AnId</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681209980"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-227"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681209978"><span class="hs-identifier hs-var">pcontents</span></a></span><span>
</span><span id="line-228"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-229"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681209973"><span class="annot"><span class="annottext">depthBound :: Int
</span><a href="#local-6989586621681209973"><span class="hs-identifier hs-var hs-var">depthBound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">100</span></span><span>
</span><span id="line-230"></span><span>      </span><span class="hs-comment">-- If the value is an exception, make sure we catch it and</span><span>
</span><span id="line-231"></span><span>      </span><span class="hs-comment">-- show the exception, rather than propagating the exception out.</span><span>
</span><span id="line-232"></span><span>      </span><span id="local-6989586621681209972"><span class="annot"><span class="annottext">Either SomeException Term
</span><a href="#local-6989586621681209972"><span class="hs-identifier hs-var">e_term</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m Term -&gt; m (Either SomeException Term)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; m (Either e a)
</span><a href="../../exceptions/src/Control.Monad.Catch.html#try"><span class="hs-identifier hs-var">MC.try</span></a></span><span> </span><span class="annot"><span class="annottext">(m Term -&gt; m (Either SomeException Term))
-&gt; m Term -&gt; m (Either SomeException Term)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Id -&gt; m Term
forall (m :: * -&gt; *). GhcMonad m =&gt; Int -&gt; Bool -&gt; Id -&gt; m Term
</span><a href="GHC.html#obtainTermFromId"><span class="hs-identifier hs-var">GHC.obtainTermFromId</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681209973"><span class="hs-identifier hs-var">depthBound</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681209980"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-233"></span><span>      </span><span id="local-6989586621681209970"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681209970"><span class="hs-identifier hs-var">docs_term</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either SomeException Term
</span><a href="#local-6989586621681209972"><span class="hs-identifier hs-var">e_term</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-234"></span><span>                      </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681209969"><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681209969"><span class="hs-identifier hs-var">term</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Term -&gt; m SDoc
forall (m :: * -&gt; *). GhcMonad m =&gt; Term -&gt; m SDoc
</span><a href="GHC.Runtime.Debugger.html#showTerm"><span class="hs-identifier hs-var">showTerm</span></a></span><span> </span><span class="annot"><span class="annottext">Term
</span><a href="#local-6989586621681209969"><span class="hs-identifier hs-var">term</span></a></span><span>
</span><span id="line-235"></span><span>                      </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621681209968"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621681209968"><span class="hs-identifier hs-var">exn</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;*** Exception:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-236"></span><span>                                            </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621681209968"><span class="hs-identifier hs-var">exn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; m SDoc) -&gt; SDoc -&gt; m SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681209976"><span class="hs-identifier hs-var">pprdId</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#equals"><span class="hs-identifier hs-var">equals</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681209970"><span class="hs-identifier hs-var">docs_term</span></a></span><span>
</span><span id="line-238"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; m SDoc
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681209976"><span class="hs-identifier hs-var">pprdId</span></a></span><span>
</span><span id="line-239"></span></pre></body></html>